<template>
	<view class="container" >
		<u-navbar :leftText="isEdit ? '编辑优惠券' : '添加优惠券'" @leftClick="goBack" leftIconColor="#1D2129"
			bgColor="transparent">
		</u-navbar>
		<view class="content">
			<scroll-view scroll-y class="content_scroll_view">
				<u-form v-if="!isNext" ref="form" labelPosition="left" :rules="rules" :model="formData"
					labelWidth="auto" :labelStyle="labelStyle">
					<view class="item_card">
						<view class="card_title">基础信息</view>
						<u-form-item label="优惠券名称" prop="name" required>
							<u--input v-model="formData.name" placeholder="请输入活动名称 (限20个字)" border="none"
								inputAlign="right" class="custom_input" maxlength="20"></u--input>
						</u-form-item>
						<view class="divider"></view>

						<u-form-item label="优惠券类型" prop="type" required :class="isEdit ? 'form_item_disabled' : ''">

							<view class="custom_input_container" :style="{ 'pointer-events': isEdit ? 'none' : 'auto' }"
								@click="showCouponTypePop()">
								<u--input v-model="formData.type" placeholder="请选择优惠券类型" border="none"
									inputAlign="right" readonly class="custom_input"></u--input>


							</view>
							<u-icon name="arrow-right" color="#191919" class="arrow_right"></u-icon>
						</u-form-item>
						<view class="divider"></view>
						<u-form-item v-if="formData.type == '满减券'" label="优惠券内容" prop="reduction" required
							:class="isEdit ? 'form_item_disabled' : ''"
							:style="{ 'pointer-events': isEdit ? 'none' : 'auto' }">
							<view class="custom-input-box">
								<view class="right-input">
									减 <view class="small-input">
										<u--input v-model="formData.reduction" placeholder="" min='1' color="#BFBFBF"
											@blur="autoFix($event, 'reduction')" inputAlign="center" type="digit"
											border="none" disabledColor="transparent"></u--input>
									</view>元
								</view>
							</view>
						</u-form-item>
						<u-form-item v-if="formData.type == '随机券'" label="随机" prop="reduction" required
							:class="isEdit ? 'form_item_disabled' : ''"
							:style="{ 'pointer-events': isEdit ? 'none' : 'auto' }">
							<view class="custom-random-box">
								减
								<view v-for="(item, index) in formData.randomReduction" :key="index" class="input-box">
									<u--input border="none" v-model="formData.randomReduction[index]" placeholder=""  color="#BFBFBF"
										type="digit" inputAlign="right" @blur="autoRandom($event, index)"
										disabledColor="transparent"></u--input>
								</view>
								元
							</view>
						</u-form-item>
						<u-form-item v-if="formData.type == '折扣券'" label="优惠内容" prop="reduction" required
							:class="isEdit ? 'form_item_disabled' : ''"
							:style="{ 'pointer-events': isEdit ? 'none' : 'auto' }">
							<view class="custom-input-box">
								<view class="right-input">
									<!-- 		减<u--input class="small-input" v-model="formData.reduction" placeholder=""
										@blur="reductionBlur($event)" inputAlign="right" type="digit"
										disabledColor="transparent"></u--input>折 -->
									<view class="small-input">
										<u--input v-model="formData.reduction" placeholder=""  color="#BFBFBF"
											@blur="reductionBlur($event)" inputAlign="center" type="digit" border="none"
											disabledColor="transparent"></u--input>
									</view>折
								</view>
							</view>
						</u-form-item>
						<view class="divider"></view>
						<u-form-item label="数量" prop="total" required :class="isEdit ? 'form_item_disabled' : ''"
							:style="{ 'pointer-events': isEdit ? 'none' : 'auto' }">
							<view class="custom-input-box">
								<view class="right-input">
									<!-- 									<u--input class="small-input" v-model="formData.total" placeholder=""
										@blur="autoFix($event,'total')" inputAlign="right" type="number"
										disabledColor="transparent"></u--input>张 -->

									<view class="small-input">
										<u--input v-model="formData.total" placeholder=""  color="#BFBFBF"
											@blur="autoFix($event, 'total')" inputAlign="center" type="number"
											border="none" disabledColor="transparent"></u--input>
									</view>张
								</view>
							</view>
						</u-form-item>
						<view class="divider"></view>
						<u-form-item v-if="isEdit" label="增发" prop="increment" required>
							<view class="custom-input-box">
								<view class="right-input">
									<!-- 									<u--input class="small-input" v-model="formData.increment" placeholder=""
										@blur="autoFix($event,'increment')" inputAlign="right" type="number"
										disabledColor="transparent"></u--input>张 -->

									<view class="small-input">
										<u--input v-model="formData.increment" placeholder=""  color="#BFBFBF"
											@blur="autoFix($event, 'increment')" inputAlign="center" type="number"
											border="none" disabledColor="transparent"></u--input>
									</view>张

								</view>
							</view>
						</u-form-item>
						<view  v-if="isEdit" class="divider"></view>
						<u-form-item label="使用门槛" prop="thresholdType" required
							:class="isEdit ? 'form_item_disabled' : ''">

							<view class="custom_input_container" :style="{ 'pointer-events': isEdit ? 'none' : 'auto' }"
								@click="showThresholdPop()">
								<u--input v-model="formData.thresholdType" placeholder="请选择参与方法" border="none"
									inputAlign="right" readonly class="custom_input"></u--input>
							</view>
							<u-icon name="arrow-right" color="#191919" class="arrow_right"></u-icon>

						</u-form-item>
						<view  v-if="formData.thresholdType == '满一定金额使用'" class="divider"></view>

						<u-form-item v-if="formData.thresholdType == '满一定金额使用'" label="门槛金额" prop="threshold" required
							:class="isEdit ? 'form_item_disabled' : ''"
							:style="{ 'pointer-events': isEdit ? 'none' : 'auto' }">
							<view class="custom-input-box">
								<view class="right-input">
									<!-- 									<u--input class="small-input" v-model="formData.threshold" placeholder=""
										type="number" max="100" min="10" @input="thresholdInput($event)"
										@blur="thresholdBlur($event)" inputAlign="right"
										disabledColor="transparent"></u--input>元 -->

									<view class="small-input">
										<u--input v-model="formData.threshold" placeholder="" color="#BFBFBF"
											@blur="thresholdBlur($event)" inputAlign="center" type="digit" border="none"
											disabledColor="transparent"></u--input>
									</view>元

								</view>
							</view>
						</u-form-item>
						<!-- <view class="divider"></view> -->


						<!-- <view class="divider no_margin_bottom"></view> -->
					</view>
					<view class="item_card">
						<view class="card_title">使用规则</view>
						<u-form-item label="允许与其他可叠加优惠劵叠加使用" class="no_form_label_margin_left"
							:class="isEdit ? 'form_item_disabled' : ''"
							:style="{ 'pointer-events': isEdit ? 'none' : 'auto' }">
							<view class="custom-input-box">
								<u-switch :style="{ 'opacity': isEdit ? '0.5' : '1' }" v-model="formData.withOthers"
									@change="change"></u-switch>
							</view>
						</u-form-item>
						<view class="input-bottom"></view>
						<u-form-item label="允许与自身叠加使用" class="no_form_label_margin_left"
							:class="isEdit ? 'form_item_disabled' : ''"
							:style="{ 'pointer-events': isEdit ? 'none' : 'auto' }">
							<view class="custom-input-box">
								<u-switch :style="{ 'opacity': isEdit ? '0.5' : '1' }" v-model="formData.withSelf"
									@change="change"></u-switch>
							</view>
						</u-form-item>
						<view class="input-bottom"></view>
						<u-form-item label="适用商品" prop="goodsType" @click="showGoodsPop()"
							:class="isEdit ? 'form_item_disabled' : ''">

							<view class="custom_input_container" :style="{ 'pointer-events': isEdit ? 'none' : 'auto' }"
								@click="showGoodsPop()">
								<u--input v-model="formData.goodsType" placeholder="请选择适用商品" border="none"
									inputAlign="right" readonly class="custom_input"></u--input>
							</view>
							<u-icon name="arrow-right" color="#191919" class="arrow_right"></u-icon>

						</u-form-item>
						<view class="input-bottom"></view>
						<view v-if="formData.goodsType == '部分商品'" class="add_num" @click="showProductPop">+ 选择商品</view>
						<view v-if="formData.goodsType == '部分商品'" class="input-bottom"></view>

						<!-- 已选择商品列表 -->
						<scroll-view v-if="selectedProduct.length > 0" :style="{ height: scrollViewHeight + 'rpx' }"
							:scroll-y="true" :scroll-with-animation="true" class="productItems_box">

							<!-- <div class="productItems_box"> -->
							<div class="productItems" v-for="(ite, idx) in selectedProduct" :key="idx"
								:style="{ 'opacity': isEdit ? '0.5' : '1' }">
								<!-- <checkbox class="checkbox" v-model="ite.selected" :value="ite.selected" :checked="ite.selected"></checkbox> -->
								<!-- <u-checkbox class="checkbox" v-model="ite.selected"></u-checkbox> -->
								<div class="productItems_left">
									<div class="productItems_left_img">
										<image :src="ite.cover || ''" mode=""></image>
									</div>
								</div>
								<div class="productItems_right">
									<div class="productItems_right_top">
										<div class="productItems_right_top_left ex">
											{{ ite.title }}
										</div>

										<div class="" @click="reduceProduct(ite, idx)"
											:style="{ 'pointer-events': isEdit ? 'none' : 'auto' }">
											<img class="productItems_right_img" src="@/static/image/reduce_product.png"
												alt="" />
										</div>
									</div>
									<div class="productItems_right_bottom">
										<!-- 	<div class="productItems_right_top_right">
											库存：{{ite.countStock}}
										</div> -->
										<div class="productItems_right_bottom_left">
											¥{{ ite.price }}
										</div>
										<!-- 	<div class="productItems_right_top_right">
											类型: {{ite.productType=='1'? '实物商品' : '虚拟商品'}}
										</div> -->
									</div>
								</div>
							</div>


							<!-- </div> -->


							<div class="zj_space">

							</div>
						</scroll-view>

						<u-form-item label="使用时间" prop="dateType" required @click="isShowDatePop = true"
							:class="isEdit ? 'form_item_disabled' : ''">

							<view class="custom_input_container" :style="{ 'pointer-events': isEdit ? 'none' : 'auto' }"
								@click="isShowDatePop = true">
								<u--input v-model="formData.dateType" placeholder="请选择使用时间" border="none"
									inputAlign="right" readonly class="custom_input"></u--input>
							</view>
							<u-icon name="arrow-right" color="#191919" class="arrow_right"></u-icon>

						</u-form-item>
						<view class="input-bottom"></view>

						<u-form-item v-if="formData.dateType == '固定时间'" label="起止日期" prop="dateRange" required
							:class="isEdit ? 'form_item_disabled' : ''">

							<view class="custom_input_container" :style="{ 'pointer-events': isEdit ? 'none' : 'auto' }"
								@click="isShowCalendar = true">
								<u--input v-model="formData.dateRange" placeholder="开始日期  ~  结束日期" border="none"
									inputAlign="right" readonly class="custom_input"></u--input>
							</view>

						</u-form-item>

						<u-form-item v-if="formData.dateType != '固定时间'" label="有效天数" prop="date" required
							:class="isEdit ? 'form_item_disabled' : ''"
							:style="{ 'pointer-events': isEdit ? 'none' : 'auto' }">
							<view class="custom-input-box">
								<view class="right-input">
									<!-- 									<u--input class="small-input" v-model="formData.date" placeholder=""
										@blur="autoFix($event,'date')" inputAlign="right" type="number"
										disabledColor="transparent"></u--input>天 -->

									<view class="small-input">
										<u--input v-model="formData.date" placeholder="" @blur="autoFix($event, 'date')"  color="#BFBFBF"
											inputAlign="center" type="number" border="none"
											disabledColor="transparent"></u--input>
									</view>天
								</view>
							</view>
						</u-form-item>

						<view class="input-bottom"></view>

					</view>
				</u-form>

				<!-- 下一步的表单 -->
				<u-form v-if="isNext" ref="form2" labelPosition="left" :rules="rules" :model="formData2"
					labelWidth="auto" :labelStyle="labelStyle">
					<view class="item_card">
						<view class="card_title">更多设置</view>
						<u-form-item label="领取限制" prop="limit" required
							:class="isEdit ? 'form_item_disabled' : ''">
<!-- 							<u--input v-model="formData2.limit" placeholder="请选择领取限制" border="none" inputAlign="right"
								disabledColor="transparent"></u--input> -->

							<view class="custom_input_container" :style="{ 'pointer-events': isEdit ? 'none' : 'auto' }"
								@click="isShowLimit = true">
								<u--input v-model="formData2.limit" placeholder="请选择领取限制" border="none"
									inputAlign="right" readonly class="custom_input"></u--input>
							</view>
							<u-icon name="arrow-right" color="#191919" class="arrow_right"></u-icon>

						</u-form-item>
						<u-form-item v-if="formData2.limit == '限制领取'" label="每人限领" prop="recvLimit" required
							:class="isEdit ? 'form_item_disabled' : ''"
							:style="{ 'pointer-events': isEdit ? 'none' : 'auto' }">
							<view class="custom-input-box">
								<view class="right-input">
									<!-- 									<u--input class="small-input" v-model="formData2.recvLimit" placeholder=""
										@blur="autoFix2($event,'recvLimit')" inputAlign="right" type="number"
										disabledColor="transparent"></u--input>次 -->

									<view class="small-input">
										<u--input v-model="formData2.recvLimit" placeholder=""  color="#BFBFBF"
											@blur="autoFix2($event, 'recvLimit')" inputAlign="center" type="number"
											border="none" disabledColor="transparent"></u--input>
									</view>次
								</view>
							</view>
						</u-form-item>
						<u-form-item label="允许分享给好友领取" prop="isShare" class="no_form_label_margin_left"
							:class="isEdit ? 'form_item_disabled' : ''"
							:style="{ 'pointer-events': isEdit ? 'none' : 'auto' }">
							<view class="custom-input-box">
								<u-switch :style="{ 'opacity': isEdit ? '0.5' : '1' }" v-model="formData2.isShare"
									@change="change"></u-switch>
							</view>
						</u-form-item>
						<view class="input-bottom"></view>
						<u-form-item label="优惠劵可与限时特价活动叠加使用" prop="timeActivities" class="no_form_label_margin_left"
							:class="isEdit ? 'form_item_disabled' : ''"
							:style="{ 'pointer-events': isEdit ? 'none' : 'auto' }">
							<view class="custom-input-box">
								<u-switch :style="{ 'opacity': isEdit ? '0.5' : '1' }"
									v-model="formData2.timeActivities" @change="change"></u-switch>
							</view>
						</u-form-item>
						<view class="input-bottom"></view>
						<u-form-item label="优惠劵可与拼团活动叠加使用" prop="groupActivities" class="no_form_label_margin_left"
							:class="isEdit ? 'form_item_disabled' : ''"
							:style="{ 'pointer-events': isEdit ? 'none' : 'auto' }">
							<view class="custom-input-box">
								<u-switch :style="{ 'opacity': isEdit ? '0.5' : '1' }"
									v-model="formData2.groupActivities" @change="change"></u-switch>
							</view>
						</u-form-item>
						<view class="input-bottom"></view>
						<u-form-item label="可在适用商品详情页领取" prop="productReceive" class="no_form_label_margin_left"
							:class="isEdit ? 'form_item_disabled' : ''"
							:style="{ 'pointer-events': isEdit ? 'none' : 'auto' }">
							<view class="custom-input-box">
								<u-switch :style="{ 'opacity': isEdit ? '0.5' : '1' }"
									v-model="formData2.productReceive" @change="change"></u-switch>
							</view>
						</u-form-item>
						<view class="input-bottom"></view>
						<u-form-item label="退款时退还优惠劵" prop="refoundReturn" class="no_form_label_margin_left"
							:class="isEdit ? 'form_item_disabled' : ''"
							:style="{ 'pointer-events': isEdit ? 'none' : 'auto' }">
							<view class="custom-input-box">
								<u-switch :style="{ 'opacity': isEdit ? '0.5' : '1' }" v-model="formData2.refoundReturn"
									@change="change"></u-switch>
							</view>
						</u-form-item>
						<view class="input-bottom"></view>
						<u-form-item label="余量显示" prop="marginDisplay" class="no_form_label_margin_left">
							<view class="custom-input-box">
								<u-switch v-model="formData2.marginDisplay" @change="change"></u-switch>
							</view>
						</u-form-item>
						<view class="left_btn" @click="viewExample(formData2.marginDisplay?'marginOn':'marginOff')">查看示例</view>
						<view class="input-bottom"></view>
						<u-form-item label="商品显示" prop="productDisplay" class="no_form_label_margin_left">
							<view class="custom-input-box">
								<u-switch v-model="formData2.productDisplay" @change="change"></u-switch>
							</view>
						</u-form-item>
						<view class="left_btn" @click="viewExample('product')">查看示例</view>
						<view class="input-bottom"></view>

					</view>

				</u-form>



				<view class="cj_space"></view>
			</scroll-view>
		</view>

		<view v-if="!isNext" class="footer">
			<u-button type="primary" color="#295FFF" shape="circle" @click="goNextForm()">下一步</u-button>
		</view>

		<view v-if="isNext" class="footer">
			<u-button class="back-btn" type="primary" :plain="true" shape="circle"
				@click="isNext = false">上一步</u-button>
			<u-button class="submit-btn" type="primary" color="#295FFF" shape="circle" @click="submit()">保存</u-button>
		</view>


		<!-- 优惠券类型 -->
		<u-popup :show="isShowCouponTypePop" round="10" @close="closeCouponTypePop" mode="bottom">
			<view class="pop-container">
				<view class="avatar-pop-box">
					<view class="pop-item" @click="chooseCouponType('满减券')">
						满减券
					</view>
					<view class="pop-item" @click="chooseCouponType('折扣券')">
						折扣券
					</view>
					<view class="pop-item" @click="chooseCouponType('随机券')">
						随机券
					</view>
				</view>
				<view class="pop-cancel-item" @click="closeCouponTypePop">
					取消
				</view>
			</view>
		</u-popup>

		<!-- 门槛类型 -->
		<u-popup :show="isShowThresholdPop" round="10" @close="closeThresholdPop" mode="bottom">
			<view class="pop-container">
				<view class="avatar-pop-box">
					<view class="pop-item" @click="chooseThresholdType('无门槛')">
						无门槛
					</view>
					<view class="pop-item" @click="chooseThresholdType('满一定金额使用')">
						满一定金额使用
					</view>
				</view>
				<view class="pop-cancel-item" @click="closeThresholdPop">
					取消
				</view>
			</view>
		</u-popup>

		<!--商品类型 -->
		<u-popup :show="isShowGoodsPop" round="10" @close="closeGoodsPop" mode="bottom">
			<view class="pop-container">
				<view class="avatar-pop-box">
					<view class="pop-item" @click="chooseGoodsType('全部商品')">
						全部商品
					</view>
					<view class="pop-item" @click="chooseGoodsType('部分商品')">
						部分商品
					</view>
				</view>
				<view class="pop-cancel-item" @click="closeGoodsPop">
					取消
				</view>
			</view>
		</u-popup>

		<!--商品类型 -->
		<u-popup :show="isShowDatePop" round="10" @close="isShowDatePop = false" mode="bottom">
			<view class="pop-container">
				<view class="avatar-pop-box">
					<view class="pop-item" @click="chooseDate('固定时间')">
						固定时间
					</view>
					<view class="pop-item" @click="chooseDate('领取当日生效')">
						领取当日生效
					</view>
					<view class="pop-item" @click="chooseDate('领取次日生效')">
						领取次日生效
					</view>
				</view>
				<view class="pop-cancel-item" @click="isShowDatePop = false">
					取消
				</view>
			</view>
		</u-popup>

		<!--商品类型 -->
		<u-popup :show="isShowLimit" round="10" @close="isShowLimit = false" mode="bottom">
			<view class="pop-container">
				<view class="avatar-pop-box">
					<view class="pop-item" @click="chooseLimit('不限制')">
						不限制
					</view>
					<view class="pop-item" @click="chooseLimit('限制领取')">
						限制领取
					</view>
				</view>
				<view class="pop-cancel-item" @click="isShowLimit = false">
					取消
				</view>
			</view>
		</u-popup>



		<!-- 起止日期  日历选择 -->
		<u-calendar :show="isShowCalendar" mode="range" @confirm="confirmDate($event)"
			@close=" isShowCalendar = false"></u-calendar>


		<u-overlay :show="showExample" @click="showExample = false">
			<img v-if="exampleImage === 'marginOn'" class="example_image" src="@/static/image/margin_display.png" />
			<img v-if="exampleImage === 'marginOff'" class="example_image" src="@/static/image/margin_hide.png" />
			<img v-if="exampleImage === 'product'" class="example_image" src="@/static/image/product_display.png" />
			<div class="closeImg">
				<img src="@/static/image/closeSl.png" alt="">
			</div>
		</u-overlay>

		<!-- 商品 -->
		<multipleProduct @closeProductMaskEvnet='closeProductMaskEvnet' ref="productRef" v-if="isProductShow"
			@productItemsEvent='productItemsEvent' @getSelectedProduct="getSelectedProduct"
			:targetProductItems="formData.targetProductItems"></multipleProduct>
	</view>
</template>

<script>
	import multipleProduct from '@/components/multipleProduct.vue'
	export default {
		components: {
			multipleProduct
		},
		data() {
			return {
				isSaving: false,
				isEdit: true,
				isNext: false,
				isCopy: false,
				labelStyle: {
					// letterSpacing: '1px',
					marginLeft: '10px',
				},
				isShowCalendar: false,
				scrollViewHeight: 400,
				selectedProduct: [],
				isProductShow: false,
				isShowCouponTypePop: false,
				isShowThresholdPop: false,
				isShowGoodsPop: false,
				isShowDatePop: false,

				isValidate: false,
				showExample: false,
				exampleImage: '',
				dateArr: [],
				formData: {
					name: '',
					withSelf: false,
					withOthers: false,
					increment: 0,
					type: '满减券',
					randomReduction: ['1.00', '1.00', '1.00', '1.00', '1.00'],
					reduction: '1.00',
					total: '1',
					thresholdType: '无门槛',
					goodsType: '全部商品',
					threshold: '1.00',
					dateRange: '',
					dateType: '固定时间',
					targetProductItems: [],
					date: '1',
				},

				rules: {
					name: [{
						required: true,
						message: '请输入优惠券名称',
						trigger: 'blur'
					}],
					reduction: [{
						required: true,
						message: '请输入优惠内容',
					}],
					dateRange: [{
						required: true,
						message: '请输入起止日期',
						trigger: ['change','blur']
					}],
					idCard: [{
							required: true,
							message: '请输入身份证号',
							trigger: 'blur'
						},
						{
							// 自定义验证函数，见上说明
							validator: (rule, value, callback) => {
								// 上面有说，返回true表示校验通过，返回false表示不通过
								// uni.$u.test.idCard()就是返回true或者false的
								return uni.$u.test.idCard(value);
							},
							message: '身份证号格式不正确',
							// 触发器可以同时用blur和change
							trigger: ['change', 'blur'],
						}
					]
				},

				isShowLimit: false,
				formData2: {
					limit: '不限制',
					recvLimit: '1',
					isShare: true,
					timeActivities: false,
					groupActivities: false,
					productReceive: false,
					refoundReturn: true,
					marginDisplay: true,
					productDisplay: true,
				},

			}
		},
		onLoad(option) {
			this.isEdit = option.type == 'isEdit' ? true : false
			this.isCopy = option.type == 'isCopy' ? true : false
			this.couponId = option.id
			if (this.isEdit || this.isCopy) {
				this.getCouponDetail(option.id)
				this.couponId = option.id
			}
		},
		onPullDownRefresh() {
			if (this.isEdit) {
				this.getCouponDetail(this.couponId)
			} else {
				uni.stopPullDownRefresh()
			}
		},
		methods: {
			goBack() {
				uni.navigateBack();
			},
			change() {

			},
			setCursorToEnd() {
				this.$nextTick(() => {
					const inputRef = this.$refs.inputRef;
					if (inputRef) {
						const length = this.inputValue.length;
						inputRef.selectionStart = length;
						inputRef.selectionEnd = length;
					}
				});
			},
			reductionBlur(value) {
				console.log('reductionBlur', value)
				if (!value) {
					this.formData.reduction = 9;
					return
				}
				// 只允许输入数字和小数点
				value = value.replace(/[^\d.]/g, '');

				// 控制小数点只能出现一次
				value = value.replace(/\.{2,}/g, '.');
				value = value.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.');

				// 限制小数点后最多一位
				value = value.replace(/^(\-)*(\d+)\.(\d).*$/, '$1$2.$3');

				// 检查值是否在 1.0 到 9.9 之间
				if (value && parseFloat(value) < 1.0) {
					console.log('reductionBlur1', value)
					value = 1.0;
				} else if (value && parseFloat(value) > 9.9) {
					console.log('reductionBlur2', value)
					value = 9.9;
				}

				console.log('value2', value);

				// 更新 formData.threshold 的值
				this.formData.reduction = value;
			},

			thresholdBlur(value) {
				// 只允许输入数字和小数点
				value = value.replace(/[^\d.]/g, '');

				// 控制小数点只能出现一次
				value = value.replace(/\.{2,}/g, '.');
				value = value.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.');

				// 限制小数点后最多两位
				value = value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');
				// 限制最大值不超过 999999
				if (parseFloat(value) > 999999) {
					value = '999999';
				}
				value = value == 0 ? 1 : value
				this.formData.threshold = parseFloat(value).toFixed(2);
			},

			thresholdInput(value) {
				// console.log('value', value )
			},
			async getCouponDetail(id) {
				let params = {
					couponId: id || '1807429814529822720',
					// 1719676800
					// 1719705600000
				}
				const res = await this.$request(this.$Api.couponDetail, params, "get")
				console.log('res', res)
				const data = res.data.data

				if (data.timeRangeType == 1) {
					this.formData.dateType = '固定时间'
					this.dateArr = [data.startTime * 1000, data.endTime * 1000];
				} else if (data.timeRangeType == 2) {
					this.formData.dateType = '领取当日生效'
					this.formData.date = data.startTime / 86400;
				} else {
					this.formData.dateType = '领取次日生效'
					this.formData.date = data.startTime / 86400;
				}

				if (data.type == 1) {
					this.formData.type = '满减券'
				} else if (data.type == 2) {
					this.formData.type = '折扣券'
				} else {
					this.formData.type = '随机券'
				}


				this.formData.name = data.name
				this.formData.reduction = data.type == 1 ? data.reduction / 100 : data.reduction / 10;
				this.formData.randomReduction = data.randomReduction.length > 0 ? data.randomReduction.map((item) =>
					item / 100) : [1, 1, 1, 1, 1]
				this.formData.total = data.total
				this.formData.threshold = data.threshold / 100
				this.formData.thresholdType = data.threshold == 0 ? '无门槛' : '满一定金额使用'
				if (this.isEdit) {
					this.formData.dateRange = data.timeRangeStr
				} else {
					this.formData.dateRange = ''
				}
				this.formData.targetProductItems = data.targetProductItems
				this.formData.withOthers = data.overlapSetting.includes(1) ? true : false
				this.formData.withSelf = data.overlapSetting.includes(2) ? true : false

				this.selectedProduct = data.targetProductList

				this.formData2.limit = data.recvLimit == 0 ? '不限制' : '限制领取'
				this.formData2.recvLimit = data.recvLimit
				this.formData2.isShare = data.enableShare == 1 ? true : false
				this.formData2.productReceive = data.enablePublic == 1 ? true : false
				this.formData2.refoundReturn = data.refundSetting == 1 ? true : false
				this.formData2.productDisplay = data.displayProduct == 1 ? true : false
				this.formData2.marginDisplay = data.displayRemainder == 1 ? true : false
				this.formData2.timeActivities = data.activityOverlap.includes(2) ? true : false
				this.formData2.groupActivities = data.activityOverlap.includes(1) ? true : false
				let test = data.overlapSetting.includes(1)
				console.log('test', test);
				console.log('data.overlapSetting.includes', data.overlapSetting)
				console.log('this.formData', this.formData, this.formData2)



				uni.stopPullDownRefresh()
			},

			autoRandom(value, index) {
				console.log('autoRandom', index, this.formData.randomReduction[index])
				if (!this.formData.randomReduction[index]) {
					// this.$nextTick(()=>{
					// 	this.formData.randomReduction[index] = '0.01'

					// })
					this.$set(this.formData.randomReduction, index, '0.01')
				} else {
					// 只允许输入数字和小数点
					value = value.replace(/[^\d.]/g, '');

					// 控制小数点只能出现一次
					value = value.replace(/\.{2,}/g, '.');
					value = value.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.');

					// 限制小数点后最多两位
					value = value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');
					// 限制最大值不超过 999999
					if (parseFloat(value) > 999999) {
						value = 999999;
					} else if (parseFloat(value) < 0.01) {
						value = 0.01;
					}
					this.$set(this.formData.randomReduction, index, value)
				}
			},

			// changeInput(e) {
			// 	console.log('change', e)
			// },

			// onInput(event,form,type) {
			// 	   // 使用正则表达式匹配正整数
			// 	      const regex = /^[1-9]\d*$/;
			// 	      // 如果输入的值不是正整数，则将其设置为上一次的值，即不允许输入非正整数的值
			// 	      if (!regex.test(event)) {
			// 			  console.log('错误', this.formData[type])
			// 			  console.log('错误', this.formData[type].substring(0, event.length - 1))
			// 	        this.formData[type] = this.formData[type].substring(0, event.length - 1);
			// 	      }
			// },

			autoFix(value, item) {
				// value = value == 0 ? 1.00 : value
				console.log('value,item', value, item)
				console.log('autoFix', item, this.formData[item])
				if (!this.formData[item]) {
					if (item == 'increment') {
						this.$set(this.formData, item, '0')
					} else {
						this.$set(this.formData, item, '1')
					}
				}
				switch (item) {
					case 'reduction':
						// 只允许输入数字和小数点
						value = value.replace(/[^\d.]/g, '');

						// 控制小数点只能出现一次
						value = value.replace(/\.{2,}/g, '.');
						value = value.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.');

						// 限制小数点后最多一位
						// value = value.replace(/^(\-)*(\d+)\.(\d).*$/, '$1$2.$3');
						value = value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');
						// 限制最大值不超过 999999
						if (parseFloat(value) > '999999') {
							value = '999999';
						}
						value = value == 0 ? 1 : value
						this.formData.reduction = parseFloat(value).toFixed(2)
						break;
					case 'total':
						// 如果有小数点，则移除小数点及其后的数字
						if (value.includes('.')) {
							value = value.split('.')[0];
						}
						// 移除小数点后的数字
						value = value.split('.')[0];
						if (parseFloat(value) > '999999') {
							value = '999999';
						}
						value = value == 0 ? 1 : value
						this.formData.total = value
						break;
					case 'increment':
						// 如果有小数点，则移除小数点及其后的数字
						if (value.includes('.')) {
							value = value.split('.')[0];
						}
						// 移除小数点后的数字
						value = value.split('.')[0];
						if (parseFloat(value) > '999999') {
							value = '999999';
						}
						this.formData.increment = value
						break;
					case 'date':
						// 如果有小数点，则移除小数点及其后的数字
						if (value.includes('.')) {
							value = value.split('.')[0];
						}
						// 移除小数点后的数字
						value = value.split('.')[0];
						if (parseFloat(value) > '999999') {
							value = '999999';
						}
						this.formData.date = value
						break;
				}
			},

			autoFix2(value, item) {
				console.log('autoFix2', item, this.formData2[item])
				if (!this.formData2[item]) {
					// this.$nextTick(()=>{
					// 	this.formData.randomReduction[index] = '0.01'

					// })
					this.$set(this.formData2, item, '1')
				} else {
					if (item == 'recvLimit') {
						// 如果有小数点，则移除小数点及其后的数字
						if (value.includes('.')) {
							value = value.split('.')[0];
						}
						if (parseFloat(value) > '999999') {
							value = '999999';
						}
						this.$set(this.formData2, item, value)
					}
				}
			},

			showCouponTypePop() {
				this.isShowCouponTypePop = true
			},
			closeCouponTypePop() {
				this.isShowCouponTypePop = false
			},
			chooseCouponType(type) {
				this.formData.type = type
				this.isShowCouponTypePop = false
				if (type == '折扣券') {
					this.formData.reduction = 9
				} else if (type == '满减券') {
					this.formData.reduction = '1.00'
				}
			},


			showThresholdPop() {
				this.isShowThresholdPop = true
			},
			closeThresholdPop() {
				this.isShowThresholdPop = false
			},
			chooseThresholdType(type) {
				this.formData.thresholdType = type
				this.formData.threshold= '1.00'
				this.isShowThresholdPop = false
			},

			showGoodsPop() {
				this.isShowGoodsPop = true
			},
			closeGoodsPop() {
				this.isShowGoodsPop = false
			},
			chooseGoodsType(type) {
				this.formData.goodsType = type
				this.isShowGoodsPop = false
			},

			showProductPop() {
				this.isProductShow = true
			},

			closeProductMaskEvnet() {
				this.isProductShow = false
			},

			getSelectedProduct(data) {
				console.log('data', data)
				this.selectedProduct = data
				this.isProductShow = false
				this.formData.targetProductItems = data.map(item => {
					return item.productId
				})
				console.log('targetProductItems', this.formData.targetProductItems)
			},

			reduceProduct(ite, idx) {
				uni.showModal({
					title: '提示',
					content: '是否确认删除？',
					success: async (res) => {
						console.log('res', res)
						if (res.confirm) {
							this.selectedProduct.splice(idx, 1)
							this.formData.targetProductItems = this.selectedProduct.map(item => {
								return item.productId
							})
						}
					}
				})
			},

			chooseDate(type) {
				console.log('chooseDate', type)
				if(type != '固定时间') {
					this.formData.dateRange = ''
				}
				this.formData.dateType = type
				this.isShowDatePop = false
				console.log('this.formData', this.formData)
			},

			confirmDate(e) {
				console.log('e', e)
				this.isShowCalendar = false
				let filterDate = e[0] + ' ~ ' + e[e.length - 1]
				// this.formData.dateRange = 
				this.$set(this.formData, 'dateRange', filterDate)
				this.dateArr = [e[0], e[e.length - 1]]
			},


			chooseLimit(type) {
				console.log('chooseLimit', type)
				this.formData2.limit = type
				this.isShowLimit = false
				console.log('this.formData', this.formData)
			},

			viewExample(imgUrl) {
				this.exampleImage = imgUrl
				this.showExample = true
			},



			inputChange(value, item) {
				item.isValidate = value ? false : true
			},
			deleteNum(index) {
				this.formData.lotteryList.splice(index, 1)
			},

			addNum() {
				this.formData.lotteryList.push({
					prizeId: '',
					name: '',
					num: ''
				})
			},
			goNextForm() {
				this.isValidate = true

				// 			formData: {
				// 				name: '',
				// 				type: '满减券',
				// 				randomReduction: [1, 1, 1, 1, 1],
				// 				reduction: '1',
				// 				total: '1',
				// 				thresholdType: '满一定金额使用',
				// 				goodsType: '全部商品',
				// 				threshold: '1',
				// 				dateRange: '',
				// 				dateType: '固定时间',
				// 				targetProductItems: [],
				// 				date: '1',
				// 			},

				// 			formData2: {
				// 				limit: '不限制',
				// 				recvLimit: '1',
				// 				isShare: true,
				// 				timeActivities: false,
				// 				groupActivities: false,
				// 				productReceive: true,
				// 				refoundReturn: true,
				// 				marginDisplay: true,
				// 				productDisplay: true,
				// 			},

				if (this.formData.goodsType == '部分商品' && this.selectedProduct.length == 0) {
					uni.showToast({
						title: '请添加适用商品',
						icon: 'none'
					})
					return
				}

				this.formData.reduction = String(this.formData.reduction)
				this.formData.total = String(this.formData.total)
				this.formData.threshold = String(this.formData.threshold)
				this.formData.date = String(this.formData.date)
				this.formData.recvLimit = String(this.formData.recvLimit)
				this.formData.increment = String(this.formData.increment)

				this.$refs.form.validate().then(async (valid) => {
					if (valid) {
						this.isNext = true
						// return uni.showToast({
						// 	title: '请先阅读并同意《认证说明》',
						// 	icon: 'none',
						// 	duration: 2000
						// })
					}
				}).catch((e) => {});
			},
			submit() {
				console.log('this.formData', this.formData)
				console.log('this.formData2', this.formData2)
				if (this.isSaving) return
				this.isSaving = true
				if (this.isEdit) {
					this.update()
				} else {
					this.save()
				}
			},
			async update() {
				let params = {
					couponId: this.couponId || '1807429814529822720',
					name: this.formData.name,
					increment: Number(this.formData.increment),
					displayProduct: this.formData2.productDisplay ? 1 : 0,
					displayRemainder: this.formData2.marginDisplay ? 1 : 0,
				}
				const res = await this.$request(this.$Api.couponUpdate, params, "post")
				if (res.data.code == 200) {
					uni.showToast({
						title: '更新成功',
						icon: 'none'
					})
					setTimeout(() => {
						this.goBack()
					}, 1000)
				} else {
					this.isSaving = false
				}
			},
			async save() {
				// 领取时间过滤
				let timeRangeType;
				let startTime;
				let endTime;
				if (this.formData.dateType == '固定时间') {
					timeRangeType = 1
					// if(this.isCopy) {
					// 	startTime = Number(this.dateArr[0]) / 1000;
					// 	endTime = Number(this.dateArr[1]) / 1000;
					// }else {
						startTime = Date.parse(this.dateArr[0]) / 1000;
						endTime = Date.parse(this.dateArr[1]) / 1000;
					// }
					
				} else if (this.formData.dateType == '领取当日生效') {
					timeRangeType = 2
					startTime = Number(this.formData.date) * 86400;
				} else {
					timeRangeType = 3
					startTime = Number(this.formData.date) * 86400;
				}

				// 优惠券类型过滤
				let type;
				let reduction;
				let randomReduction;
				if (this.formData.type == '满减券') {
					type = 1
				} else if (this.formData.type == '折扣券') {
					type = 2
				} else {
					type = 3
				}

				// 使用规则叠加数据过滤
				let overlapSetting = []
				if (this.formData.withOthers) {
					overlapSetting.push(1)
				}
				if (this.formData.withSelf) {
					overlapSetting.push(2)
				}

				// 活动叠加数据过滤
				let activityOverlap = []
				if (this.formData2.groupActivities) {
					activityOverlap.push(1)
				}
				if (this.formData2.timeActivities) {
					activityOverlap.push(2)
				}
				console.log('111', this.formData, type, this.formData2)


				let params = {
					timeRangeType,
					startTime,
					name: this.formData.name,
					endTime: timeRangeType == 1 && this.dateArr.length > 0 ? endTime : undefined,
					type,
					reduction: type == 1 ? Number(Number(this.formData.reduction * 100).toFixed(2)) : Number(this
						.formData.reduction *
						10),
					randomReduction: this.formData.randomReduction.map((item) => item * 100),
					total: Number(this.formData.total),
					threshold: this.formData.thresholdType == '满一定金额使用' ? Number(Number(this.formData.threshold *
						100).toFixed()) : 0,
					overlapSetting,
					targetProductType: this.formData.goodsType == '全部商品' ? 1 : 2,
					targetProductItems: this.formData.goodsType == '全部商品' ? [] : this.formData.targetProductItems,
					activityOverlap,
					displayProduct: this.formData2.productDisplay ? 1 : 0,
					displayRemainder: this.formData2.marginDisplay ? 1 : 0,
					enablePublic: this.formData2.productReceive ? 1 : 0,
					enableShare: this.formData2.isShare ? 1 : 0,
					recvLimit: this.formData2.limit == '限制领取' ? Number(this.formData2.recvLimit) : 0,
					refundSetting: this.formData2.refoundReturn ? 1 : 2,
				}

				const res = await this.$request(this.$Api.couponCreate, params, "post")
				console.log('res', res)
				if (res.data.code == 200) {
					uni.showToast({
						title: '创建成功',
						icon: 'none'
					})
					setTimeout(() => {
						this.goBack()
					}, 1000)
				} else {
					this.isSaving = false
				}

			},

		}
	}
</script>

<style lang="scss" scoped>
	page {
		background: #F6F9FF;
	}
.closeImg{
	margin-top: 80rpx;
	width: 44rpx;
	height: 44rpx;
	position: absolute;
	left: 50%;
	top: 70%;
	transform: translate(-50%, -50%);
	img{
		width: 100%;
		height: 100%;
	}
}
	.container {
		position: relative;
		height: 100vh;
		background: url('@/static/image/my_set_bg.png') no-repeat center center;
		background-size: cover;
		overflow-y: scroll;

		::v-deep .u-navbar__content__left__text {
			font-weight: 500;
			font-size: 32rpx;
		}

		.divider {
			border-bottom: 1rpx solid #E3E8EE ;
			margin: 24rpx 0;
		}

		.input-bottom {
			margin: 24rpx 0;
		}

		.no_margin_bottom {
			margin-bottom: 0;
		}

		.u-form {
			::v-deep .u-form-item__body {
				padding: 10rpx 0;
			}

			::v-deep .u-form-item__body__left__content__required {
				left: -1px;
			}

			.no_form_label_margin_left {
				::v-deep .u-form-item__body__left__content__label {
					margin-left: 0 !important;
				}
			}

		}

		::v-deep .u-border {
			border-width: 2rpx !important;
		}

		.content {
			display: flex;
			flex-direction: column;
			margin-top: 96rpx;
			height: calc(100vh - 96rpx);
			box-sizing: border-box;
			padding: 0 32rpx;

			.content_scroll_view {
				height: calc(100vh - 210rpx);

				.item_card {
					background-color: #ffffff;
					border-radius: 16rpx;
					padding: 24rpx;
					margin-bottom: 20rpx;

					.card_title {
						height: 34rpx;
						line-height: 34rpx;
						font-weight: 400;
						font-size: 24rpx;
						color: #8C8C8C;
						margin-bottom: 24rpx;
					}

					.arrow_right {
						margin-left: 16rpx;
					}

					.left_btn {
						height: 34rpx;
						line-height: 34rpx;
						font-weight: 400;
						font-size: 24rpx;
						color: #295EFF;
					}

					.card_index {
						display: flex;
						justify-content: space-between;
						align-items: center;
						height: 40rpx;
						font-weight: 400;
						font-size: 28rpx;
						color: #295EFF;
						line-height: 40rpx;
						margin-bottom: 32rpx;

						img {
							width: 24rpx;
							height: 28rpx;
						}
					}

					.error_message {
						line-height: 12px;
						text-align: right;
						font-size: 12px;
						color: #f56c6c;
					}

					.add_num {
						height: 52rpx;
						line-height: 52rpx;
						text-align: center;
						border-radius: 8rpx;
						color: #295EFF;
						border: 2rpx solid #295EFF;
					}
				}

				.agreement {
					display: flex;
					align-items: center;
					font-size: 24rpx;
					color: #464C5B;
					margin: 50rpx 0;

					text {
						color: #295EFF;
					}
				}
			}
		}

		.cj_space {
			width: 100%;
			height: 1rpx;
		}

		.footer {
			position: fixed;
			bottom: 0;
			left: 0;
			width: 100%;
			height: 166rpx;
			box-sizing: border-box;
			padding: 20rpx 40rpx 66rpx 40rpx;
			background: #FFFFFF;
			box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(210, 210, 210, 0.5);
			display: flex;
			align-items: center;
		}

		.example_image {
			position: absolute;
			left: 50%;
			top: 50%;
			transform: translate(-50%, -50%);
			max-height: 100%;
			max-width: 70%;
		}


		.pop-container {
			font-size: 34rpx;
			color: #000000;
			text-align: center;
			background-color: #F2F2F2;

			.pop-item {
				padding: 32rpx 0;
				background-color: #FFFFFF;
				margin-bottom: 2rpx;
			}

			.pop-cancel-item {
				background-color: #FFFFFF;
				padding: 32rpx 0;
				margin-top: 16rpx;
			}
		}

		.custom-input-box {
			display: flex;
			justify-content: flex-end;
			width: 100%;

			.right-input {
				display: flex;
				align-items: center;
			}
		}

		.custom-random-box {
			width: 100%;
			display: flex;
			justify-content: flex-end;
			align-items: center;

			.input-box {
				width: 72rpx;
				height: 42rpx;
				padding: 6rpx 4rpx;
				// margin: 0 16rpx;
				margin-right: 8rpx;
				border-radius: 8rpx;
				border: 2rpx solid #dadbde;
			}

			.input-box:first-child {
				margin-left: 8rpx;
			}
		}


		.productItems_box {
			width: 100%;
			height: auto;
			// background: #FFFFFF;
			background: #f6faff;
			padding: 24rpx 18rpx;
			box-sizing: border-box;
			border-radius: 8rpx;

		}

		.productItems {
			width: 100%;
			min-height: 144rpx;
			// background: #F5F9FF;
			background: #FFFFFF;
			border-radius: 8rpx;
			margin-bottom: 24rpx;
			padding: 24rpx 20rpx;
			box-sizing: border-box;
			display: flex;
			align-items: center;
			justify-content: flex-start;

			.productItems_left {
				.productItems_left_img {
					width: 172rpx;
					height: 112rpx;
				}
			}

			.productItems_right {
				margin-left: 24rpx;
				width: calc(100% - 210rpx);

				.productItems_right_top,
				.productItems_right_bottom {
					display: flex;
					align-items: center;
					justify-content: space-between;
					height: 40rpx;

					.productItems_right_top_left {
						width: calc(100% - 180rpx);
						font-weight: 500;
						font-size: 28rpx;
						color: #464C5B;
						height: 40rpx;
						line-height: 40rpx;
						text-align: left;

					}



				}

				.productItems_right_top_right {
					font-size: 24rpx;
					color: #657180;
				}

				.productItems_right_bottom_left {
					color: #FF5A5F;
					font-size: 28rpx;

					font-weight: bold;

					span {
						color: #BFBFBF;
						font-size: 24rpx;
						margin-left: 16rpx;
						font-weight: 500;
					}

				}

				.productItems_right_img {
					width: 32rpx;
					height: 32rpx;
				}

				.productItems_right_bottom {
					margin-top: 28rpx;



					.productItems_right_bottom_right {
						width: 88rpx;
						height: 48rpx;
						background: #295EFF;
						border-radius: 8rpx;
						font-size: 28rpx;
						color: #fff;
						text-align: center;
						line-height: 48rpx;

					}

				}
			}
		}





		.prizeDraw_top {
			width: 100%;
			height: 100rpx;
			position: relative;
			text-align: center;
			font-size: 32rpx;
			line-height: 100rpx;
			border-bottom: 2rpx solid #D8D8D8;

			.prizeDraw_top_close {
				padding: 0 18rpx;
				display: flex;
				justify-content: space-between;

				.top-left {
					color: #657180;
				}

				.top-middle {
					color: #1D2129;
				}

				.top-right {
					color: #0073FF;
				}
			}


			.prizeDraw_top_close_left {
				position: absolute;
				left: 0;
				top: 10rpx;
				width: 44rpx;
				height: 44rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}


			.closeImg {
				position: absolute;
				right: 0;
				top: 32rpx;
				width: 32rpx;
				height: 32rpx;
			}

		}


		.prizeDraw_top_title {
			width: 100%;
			height: 96rpx;
			font-size: 28rpx;
			color: #464C5B;
			text-align: left;
			font-weight: 500;
			line-height: 64rpx;
			padding: 0 32rpx;
			padding: 0 32rpx;
			box-sizing: border-box;
			position: relative;
			padding-bottom: 32rpx;

			input {
				width: 100%;
				height: 100%;
				border: 1rpx solid #979797;
				border-radius: 16rpx;
				padding: 0 124rpx 0 24rpx;
				box-sizing: border-box;
				font-size: 24rpx;

			}

			.inputSeach {
				width: 32rpx;
				height: 32rpx;
				position: absolute;
				right: 56rpx;
				top: 6rpx;
			}

		}


		.prizeDraw_user_item_top {
			width: 100%;
			height: 110rpx;
			border-bottom: 1rpx solid #D7DDE4;
			display: flex;
			justify-content: flex-start;
			padding: 0 24rpx;
			box-sizing: border-box;
			align-items: center;

			.prizeDraw_user_item_top_left {
				width: 62rpx;
				height: 62rpx;
				margin-right: 16rpx;

				image {
					border-radius: 50%;
				}
			}

		}

		.prizeDraw_items_cont_items {
			display: flex;
			align-items: center;
			justify-content: space-between;
			height: 40rpx;
			margin-top: 20rpx;
			padding: 0 24rpx;
			box-sizing: border-box;
			font-size: 24rpx;

			color: #8C8C8C;

			.prizeDraw_items_cont_items_left {
				width: 100%;
				display: flex;
				align-items: center;


				.color_blue {
					color: #295EFF;
				}

				.prizeDraw_items_cont_items_cont {
					width: 480rpx;
					text-align: left;
					color: #464C5B;
				}
			}

		}

		.listSpace {
			padding-top: 100rpx;
		}

		.color_hui {
			background: #C8C9CC !important;
		}

		.checkbox {
			margin-right: 8rpx;
		}

		.back-btn {
			width: 40vw;
			border: 2rpx solid #D7D7D7;
		}

		.submit-btn {
			width: 40vw;
		}

		.custom_input_container {
			width: 100%;
			font-size: 28rpx;

			.custom_input {
				pointer-events: none;
			}
		}

		.form_item_disabled {
			::v-deep .u-form-item__body__left__content__label {
				color: #DBDCDE !important;
			}

			::v-deep .u-input__content__field-wrapper__field {
				color: #DBDCDE !important;
			}

			::v-deep .u-icon__icon {
				color: #DBDCDE !important;
			}
		}
		
		.small-input {
			width: 120rpx;
			height: 62rpx;
			line-height: 62rpx;
			padding: 2rpx 8rpx;
			// height: 32rpx;
			margin: 0 16rpx;
			border-radius: 16rpx;
			border: 2rpx solid #E3E8EE;
			::v-deep .u-input {
				width:100%;
				height: 100%;
				text-align: center;
				color: #BFBFBF !important;
			}
		}
		



	}
</style>